package com.wangshouyu.mp.pay.unified;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.util.Objects;

/**
 * @author 王守钰
 * @description 付款码支付
 * @date 2020/8/13 11:24
 */
@XStreamAlias(value = "xml")
public class MicropayUnifiedRequest extends BaseUnifiedRequest{

    /**
     * 付款码
     */
    @XStreamAlias(value = "auth_code")
    private String authCode;

    /**
     * 场景信息
     */
    @XStreamAlias(value = "scene_info")
    private String sceneInfo;

    public String getAuthCode() {
        return authCode;
    }

    public void setAuthCode(String authCode) {
        this.authCode = authCode;
    }

    public String getSceneInfo() {
        return sceneInfo;
    }

    public void setSceneInfo(String sceneInfo) {
        this.sceneInfo = sceneInfo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        MicropayUnifiedRequest that = (MicropayUnifiedRequest) o;
        return Objects.equals(authCode, that.authCode) &&
                Objects.equals(sceneInfo, that.sceneInfo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), authCode, sceneInfo);
    }
}
